package com.abu.messageboard.mapper;


import com.abu.messageboard.pojo.Message;
import com.abu.messageboard.vo.MessageVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 留言表 Mapper 接口
 * </p>
 *
 * @author 阿布
 * @since 2021-02-25
 */
public interface MessageMapper extends BaseMapper<Message> {

    List<MessageVO> selectPage(@Param("page") Long page, @Param("userId") Long userId);

    Integer selectPageCount(Long page, @Param("userId") Long userId);


    List<MessageVO> selectPageAndOderASCByMgId(@Param("mgId") Long mgId, @Param("page") Long page, @Param("userId") Long userId);

    Integer selectPageAndOderByMgIdCount(Long mgId, @Param("userId") Long userId);


    List<MessageVO> selectPageByMgId(@Param("mgId") Long mgId, @Param("page") Long page, @Param("userId") Long userId);

    Integer selectPageCountMgId(@Param("mgId") Long mgId, @Param("userId") Long userId);

    List<MessageVO> selectPageAndOrderDescByMgId(@Param("mgId") Long mgId, @Param("page") Long page, @Param("userId") Long userId);
}
